<template>
  <div class="flex between main">
    <div class="main-left">
      <div class="title title1">校园简介</div>
      <div class="left-div1">
        <!-- <img src="@/assets/img.png" /> -->
        <el-carousel
          height="240px"
          arrow="always"
        >
          <el-carousel-item
            v-for="item in info?.album"
            :key="item"
          >
            <img :src="item" />
          </el-carousel-item>
        </el-carousel>
        <div class="intro">
          <!-- 
            江西科技学院位于江西省南昌市瑶湖高校园区紫阳大道115号，是一所以工学、管理学、艺术学为主，多学科协调发展的全日制民办普通本科高校，具有颁发国家承认的统招本、专科学历资格，并具有学士学位授予权。
            [1]
            学校前身是创建于1994年的江西省高级职业学校，1999年经教育部批准成为普通高职院校，改名为蓝天职业技术学院，2005年升格为普通本科院校，改名江西蓝天学院，2009年获批为学士学位授予单位，2012年更名为江西科技学院。
            [1]2015年学校获批江西省博士后创新实践基地；2022年成功获批江西省“十四五
          -->
          <div v-html="info?.intro_content"></div>
        </div>
      </div>
    </div>
    <div class="main-center">
      <div class="title title3">校园风采</div>
      <div class="banner">
        <el-carousel
          height="600px"
          arrow="always"
        >
          <el-carousel-item
            v-for="item in info?.album"
            :key="item"
          >
            <img :src="item" />
          </el-carousel-item>
        </el-carousel>
      </div>
    </div>
    <div class="main-right">
      <div class="right-div1">
        <div class="title title3">校园校训</div>
        <div style="flex: 1; overflow: hidden; text-align: center">
          <img
            src="@/assets/img2.png"
            style="width: auto; height: 100%"
          />
        </div>
      </div>
    </div>
  </div>
</template>
<script setup>
import { clazz } from "@/api/apiData";
import { onMounted, ref, inject, computed } from "vue";
import { useRoute } from "vue-router";
const { setAppTitle, setDeviceDetail, getApiClazzDetail, schoolInfo } =
  inject("global-stroe");
const info = computed(() => schoolInfo.value);
const Route = useRoute();
onMounted(() => {
  initPage();
});

/**
 * 设备初始化
 */
async function initPage() {
  const device_id = Route?.query?.deviceId  || "10001";
  const { data: device } = await clazz.device.detail({ device_id });
  setDeviceDetail(device);
  getApiClazzDetail();
  setAppTitle(device.room.name,"");
}
</script>
<style
  lang="less"
  scoped
>
.main {
  padding: 20px;
  height: 100%;
  box-sizing: border-box;
  .main-left {
    width: 452px;
    height: 100%;
    overflow: hidden;
    border-radius: 8px;

    .title1 {
      background: linear-gradient(to right, #fe9a14, #fe774a);
    }
    .left-div1 {
      background: white;
      font-size: 20px;
      padding: 16px;
      box-sizing: border-box;
      img {
        width: 100%;
        height: 240px;
      }
      .intro {
        font-size: 20px;
        text-indent: 2em;
        height: 380px;
        overflow-y: auto;
        overflow-x: hidden;
      }
    }
  }
  .main-center {
    width: 936px;
    height: 100%;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    .title3 {
      background: linear-gradient(to right, #56abf9, #5686fc);
    }
    .banner {
      flex: 1;
      padding: 16px;
      background: white;

      img {
        width: 100%;
        height: 100%;
        object-fit: cover;
      }
    }
  }
  .main-right {
    width: 452px;
    height: 100%;
    overflow: hidden;
    .right-div1 {
      height: 100%;
      display: flex;
      flex-direction: column;
      background: white;
      border-radius: 8px;
      .title3 {
        background: linear-gradient(to right, #fe3875, #fc454a);
      }
    }
  }
}
</style>
